package com.weilai.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "Hello swagger文档示例", description = "提供 hello 方法的接口")
public class HelloController {

    /**
     * Swagger 文档使用示例
     */
    @ApiOperation(value = "hello 方法", notes = "这是一个 hello 方法，用来 return hello")
    @ApiResponses({
            @ApiResponse(code = 200, message = "hello 成功")
    })
    @PostMapping(value = "/hello")
    public String hello() {
        return "hello";
    }

    // 访问 http://localhost:8080/swagger-ui.html 查看文档
}